<!DOCTYPE html>
<html lang="zh">
  <head>
    <%- monitor_config_json_script %>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="icon" type="image/svg" href="/assets/images/favicon_hai.svg" />
    <title>集群监控</title>
  </head>
  <body>
    <div id="app"></div>
    <script>
      var nVer = navigator.appVersion
      var nAgt = navigator.userAgent
      var browserName = navigator.appName
      var fullVersion = '' + parseFloat(navigator.appVersion)
      var majorVersion = parseInt(navigator.appVersion, 10)
      var nameOffset, verOffset, ix

      if ((verOffset = nAgt.indexOf('Edg')) != -1) {
        browserName = 'Microsoft Edge'
        fullVersion = nAgt.substring(verOffset + 4)
      }
      // In Chrome, the true version is after "Chrome"
      else if ((verOffset = nAgt.indexOf('Chrome')) != -1) {
        browserName = 'Chrome'
        fullVersion = nAgt.substring(verOffset + 7)
      }
      // In Firefox, the true version is after "Firefox"
      else if ((verOffset = nAgt.indexOf('Firefox')) != -1) {
        browserName = 'Firefox'
        fullVersion = nAgt.substring(verOffset + 8)
      }
      // In most other browsers, "name/version" is at the end of userAgent
      else if ((nameOffset = nAgt.lastIndexOf(' ') + 1) < (verOffset = nAgt.lastIndexOf('/'))) {
        browserName = nAgt.substring(nameOffset, verOffset)
        fullVersion = nAgt.substring(verOffset + 1)
        if (browserName.toLowerCase() == browserName.toUpperCase()) {
          browserName = navigator.appName
        }
      }
      // trim the fullVersion string at semicolon/space if present
      if ((ix = fullVersion.indexOf(';')) != -1) fullVersion = fullVersion.substring(0, ix)
      if ((ix = fullVersion.indexOf(' ')) != -1) fullVersion = fullVersion.substring(0, ix)

      majorVersion = parseInt('' + fullVersion, 10)
      if (isNaN(majorVersion)) {
        fullVersion = '' + parseFloat(navigator.appVersion)
        majorVersion = parseInt(navigator.appVersion, 10)
      }

      if (browserName === 'Chrome' && majorVersion < 80) {
        document.write(`检测到当前Chrome浏览器版本过低, 请升级至80及以上的版本<br>`)
      }

      if (browserName === 'Microsoft Edge' && majorVersion < 80) {
        document.write(`检测到当前Edge浏览器版本过低, 请升级至80及以上的版本<br>`)
      }

      if (browserName === 'Firefox' && majorVersion < 72) {
        document.write(`检测到当前Firefox浏览器版本过低, 请升级至72及以上的版本<br>`)
      }
    </script>
  </body>
</html>
